package wx.core
{
	
	import flash.system.Capabilities;
	
	import wx.themes.Theme160dpi;

	/**
	 * 
	 * @author wujianqi
	 * 
	 * 
	 */	
	public class SettingCache
	{
				
		//是否桌面应用
		public static var isNativeMode:Boolean = (Capabilities.playerType=="Desktop");
		
		//是否桌面模式（PC/MAC，MOBILE/WEB）
		public static var isWindowMode:Boolean = false;	
		public static var isMobileMode:Boolean = (!isWindowMode && isNativeMode);	
		
		//系统屏幕分辨率类型
		public static function get dpi():Number{
			var _dpi:Number  = 160;
			if(isMobileMode) {
				var dpi:Number = Capabilities.screenDPI;
				if(dpi<=160)  _dpi = 160;
				else if(dpi<=240) _dpi = 240;
				else _dpi = 320;
			}
			return _dpi;
		}
		
		public static var theme160dpi:Class = Theme160dpi;
		public static var theme240dpi:Class = Theme160dpi;
		public static var theme320dpi:Class = Theme160dpi;
		
		
		//主题皮肤
		public static function get theme():ITheme {
			var _theme:ITheme;
			switch(dpi)
			{
				case 160:
				{
					_theme = new theme160dpi();
					break;
				}
				case 240:
				{
					_theme = new theme240dpi();
					break;
				}
				case 320:
				{
					_theme = new theme320dpi();
					break;
				}
			}
			return _theme;
		};
		
		//系统可视区域
		public static var mainWidth:int = 320;
		public static var mainHeight:int = 455;
		
		
	}
}